home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 974 b | 39 lines | [TEXT/CWIE] |
- // ConstCString.h
-
- #ifndef ConstCString_h
- #define ConstCString_h
-
- #ifndef ConstData_h
- #include "ConstData.h"
- #endif
-
- class ConstCString
- {
- private:
- ConstData text;
-
- static uint32 CStringLength( const int8 * );
-
- public:
- ConstCString( const int8 * );
-
- const uint8 *Start() const { return text.Start(); }
- const uint8 *End() const { return text.End(); }
-
- uint32 Length() const { return text.Length(); }
- URange32 Range() const { return text.Range(); }
-
- bool IsEmpty() const { return Length() == 0; }
-
- const uint8& operator[]( uint32 i ) const { return text[i]; }
-
- ConstData Text() const { return text; }
- ConstData Head( uint32 position ) const { return text.Head( position ); }
- ConstData Tail( uint32 position ) const { return text.Tail( position ); }
- ConstData Middle( URange32 range ) const { return text.Middle( range ); }
-
- operator ConstData() const { return text; }
- };
-
- #endif
-